require(['jquery', 'bootstrap', 'validate'], function ($,validate) {
	var webRoot = G_WEB_ROOT;
	$("#login_form").validate({
		rules: {
			username: "required",
			password: {
				required: true,
				minlength: 5
			},
		},
		messages: {
			username: "请输入姓名",
			password: {
				required: "请输入密码",
				minlength: jQuery.format("密码不能小于{0}个字 符")
			},
		}
	});

	$("#login_form .btn").click(function () {
		var self = this;
		var form = $("#login_form");//定义一个form表单
		form.submit();//表单提交
	});




	$("#register_btn").click(function () {
		$("#register_form").css("display", "block");
		$("#login_form").css("display", "none");
	});
	$("#back_btn").click(function () {
		$("#register_form").css("display", "none");
		$("#login_form").css("display", "block");
	});
});